<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript脚本工作方式示例</title>
    <script src="./js/js01_base.js" async></script>
</head>
<body>
    <h1 id="page_title">JavaScript脚本工作方式示例</h1>

    <script>
        console.log("内部JavaScript脚本")
        alert("内部JavaScript脚本");
    </script>

    <button onclick="alert('内联JavaScript脚本');">执行内联JavaScript</button>

    <script>
        let h1 = document.getElementById("page_title");
        alert("DOM树加载完成后执行。" + h1.textContent);
        // document.addEventListener("DOMContentLoaded",function(){
        //     let h1 = document.getElementById("page_title");
        //     alert("DOM树加载完成后执行。" + h1.textContent);
        // })
    </script>

</body>
</html>